package com.fg.pro.trade.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fg.pro.model.reponse.ResponseResult;
import com.fg.pro.trade.entity.TradeStockSheet;
import com.fg.pro.trade.service.TradeStockSheetService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 库存变化-出入库总览(TradeStockSheet)表控制层
 *
 * @author makejava
 * @since 2025-08-20 10:10:15
 */
@RestController
@RequestMapping("tradeStockSheet")
public class TradeStockSheetController {
    /**
     * 服务对象
     */
    @Resource
    private TradeStockSheetService tradeStockSheetService;

    @Operation(summary = "刷新订单信息",description = "参数时间，可以不传参，默认刷新时间当前")
    @PostMapping("/refresh")
    public ResponseResult refresh(@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
                                  @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) throws InterruptedException {
        boolean flag = tradeStockSheetService.refresh(start,end);
        return ResponseResult.okResult(flag?"刷新成功":"正在刷新中。。。");
    }

}

